#include "dlg_bookadd.h"
#include "ui_dlg_bookadd.h"
#include"lib/sql_mgr.h"
dlg_bookadd::dlg_bookadd(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::dlg_bookadd)
{
    ui->setupUi(this);
}

dlg_bookadd::~dlg_bookadd()
{
    delete ui;
}

void dlg_bookadd::on_btn_confirm_clicked()
{
    QStringList l;

    l<<ui->le_ISBN->text();
    l<<ui->le_bookname->text();
    l<<ui->le_author->text();
    l<<ui->le_availnum->text();
    l<<ui->le_stronum->text();

    l<<"";

        //add
        QVector<QStringList> vec;
        vec.push_back(l);
        sql_mgr::getInstance()->AddBooks(vec);

    this->hide();
}


void dlg_bookadd::on_btn_cancal_clicked()
{
this->hide();
}

